define(function(require,exports,module){
    var Base={
		mBaserSvrUrl:window.BaseServerUrl,
		localStorage:window.localStorage
	};
	
	function JlnRequest(){
		this.params={}
	}
	module.exports=DataCaptureProxy;
function DataCaptureProxy(){
	function datacaptureSubmit(request, success, ignoreError) {
	    var url = Base.mBaserSvrUrl+'/datacapture';
        if (request.svr == null) request.svr = undefined;
	    if (request.token == null) request.token = undefined;
	    var content = JSON.stringify(request);
       
	    url = url + '?f=t&data=' + encodeURIComponent(content);
	    url = url + '&CallBack=?';
        $.getJSON(url,success);

	}

	function getSiMuWangProductInfoBySIDRq(union,productSID,success,ignoreError){
        var request=new JlnRequest();
        request.func='getSiMuWangProductInfoBySID';
        request.token = Base.localStorage.getItem('request_token');
		
		request.params['psid']=productSID;

		if (union == true) {
	        request.svr = 'datacapture';
            request.ignoreError = ignoreError;
	        request.success = success;
        }
	    return request;
    }
	this.getSiMuWangProductInfoBySIDRequest=function(productSID,success,ignoreError){
       var request= getSiMuWangProductInfoBySIDRq(true,productSID,success,ignoreError);
       return request;
    }
	this.getSiMuWangProductInfoBySID=function(productSID,success,ignoreError){
       var request= getSiMuWangProductInfoBySIDRq(false,productSID,success,ignoreError);
       datacaptureSubmit(request, success, ignoreError);

    }

	function getSiMuWangDataAnalysisBySIDRq(union,productSID,success,ignoreError){
        var request=new JlnRequest();
        request.func='getSiMuWangDataAnalysisBySID';
        request.token = Base.localStorage.getItem('request_token');
		
		request.params['psid']=productSID;

		if (union == true) {
	        request.svr = 'datacapture';
            request.ignoreError = ignoreError;
	        request.success = success;
        }
	    return request;
    }
	this.getSiMuWangDataAnalysisBySIDRequest=function(productSID,success,ignoreError){
       var request= getSiMuWangDataAnalysisBySIDRq(true,productSID,success,ignoreError);
       return request;
    }
	this.getSiMuWangDataAnalysisBySID=function(productSID,success,ignoreError){
       var request= getSiMuWangDataAnalysisBySIDRq(false,productSID,success,ignoreError);
       datacaptureSubmit(request, success, ignoreError);

    }

	function getSiMuWangProductNetListBySIDRq(union,productSID,success,ignoreError){
        var request=new JlnRequest();
        request.func='getSiMuWangProductNetListBySID';
        request.token = Base.localStorage.getItem('request_token');
		
		request.params['psid']=productSID;

		if (union == true) {
	        request.svr = 'datacapture';
            request.ignoreError = ignoreError;
	        request.success = success;
        }
	    return request;
    }
	this.getSiMuWangProductNetListBySIDRequest=function(productSID,success,ignoreError){
       var request= getSiMuWangProductNetListBySIDRq(true,productSID,success,ignoreError);
       return request;
    }
	this.getSiMuWangProductNetListBySID=function(productSID,success,ignoreError){
       var request= getSiMuWangProductNetListBySIDRq(false,productSID,success,ignoreError);
       datacaptureSubmit(request, success, ignoreError);

    }

	function getSiMuWangProductsRq(union,investmentCelve,productType,recordNumber,ifClassification,ifUmbrella,order,isAsc,page,countPerPage,success,ignoreError){
        var request=new JlnRequest();
        request.func='getSiMuWangProducts';
        request.token = Base.localStorage.getItem('request_token');
		
		request.params['ic']=investmentCelve;
		request.params['pt']=productType;
		request.params['rn']=recordNumber;
		request.params['ic0']=ifClassification;
		request.params['iu']=ifUmbrella;
		request.params['o']=order;
		request.params['ia']=isAsc;
		request.params['p']=page;
		request.params['cpp']=countPerPage;

		if (union == true) {
	        request.svr = 'datacapture';
            request.ignoreError = ignoreError;
	        request.success = success;
        }
	    return request;
    }
	this.getSiMuWangProductsRequest=function(investmentCelve,productType,recordNumber,ifClassification,ifUmbrella,order,isAsc,page,countPerPage,success,ignoreError){
       var request= getSiMuWangProductsRq(true,investmentCelve,productType,recordNumber,ifClassification,ifUmbrella,order,isAsc,page,countPerPage,success,ignoreError);
       return request;
    }
	this.getSiMuWangProducts=function(investmentCelve,productType,recordNumber,ifClassification,ifUmbrella,order,isAsc,page,countPerPage,success,ignoreError){
       var request= getSiMuWangProductsRq(false,investmentCelve,productType,recordNumber,ifClassification,ifUmbrella,order,isAsc,page,countPerPage,success,ignoreError);
       datacaptureSubmit(request, success, ignoreError);

    }
}

});
